//
//  ZTAlbumHeadView.m
//  XMLYFM
//
//  Created by dllo on 15/12/26.
//  Copyright © 2015年 zzl. All rights reserved.
//

#import "ZTAlbumHeadView.h"
#import <Masonry.h>

@implementation ZTAlbumHeadView


-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubviews];
    }
    
    return self;
}
-(void)createSubviews
{
    
    
    //专辑图片
    self.albumPic = [UIImageView new];
    self.albumPic.backgroundColor = [UIColor clearColor];
    [self addSubview:self.albumPic];
    
    [self.albumPic mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self).offset(10);
        make.top.equalTo(self).offset(20);
        make.width.offset(90);
        make.height.offset(90);
        
    }];
    

    //主播头像
    self.avatarBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.avatarBtn.backgroundColor = [UIColor clearColor];
    self.avatarBtn.layer.masksToBounds = YES;
    self.avatarBtn.layer.cornerRadius = 15;
    self.avatarBtn.layer.borderWidth = 1;
    [self.avatarBtn setImage:[UIImage imageNamed:@"loading.jpg"] forState:UIControlStateNormal];
    [self addSubview:self.avatarBtn];
    
    [self.avatarBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.albumPic.mas_right).offset(10);
        make.top.equalTo(self).offset(20);
        make.width.offset(30);
        make.height.offset(30);
        
    }];
    
    
    
    //主播名字
    self.authorName = [UILabel new];
    self.authorName.backgroundColor = [UIColor clearColor];
    self.authorName.textColor = [UIColor whiteColor];
    self.authorName.font = [UIFont systemFontOfSize:15 weight:1];
    [self addSubview:self.authorName];
    
    [self.authorName mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.avatarBtn.mas_right).offset(10);
        make.top.equalTo(self).offset(20);
        make.width.offset(100);
        make.height.offset(20);
        
    }];
    
    
    
    //专辑简介
    self.albumDigest = [UILabel new];
    self.albumDigest.backgroundColor = [UIColor clearColor];
    self.albumDigest.font = [UIFont systemFontOfSize:13 weight:0];
    [self addSubview:self.albumDigest];
    self.albumDigest.textColor = [UIColor grayColor];
    
    [self.albumDigest mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.albumPic.mas_right).offset(10);
        make.top.equalTo(self.avatarBtn.mas_bottom).offset(5);
        make.width.offset(200);
        make.height.offset(20);
        
    }];
    
    
    //分类按钮
    self.tagBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.tagBtn.frame = CGRectMake(self.albumDigest.frame.origin.x, self.albumDigest.frame.origin.y + self.albumDigest.frame.size.height + 10, 20, 20);
    self.tagBtn.backgroundColor = [UIColor clearColor];
    [self addSubview:self.tagBtn];

    
//    //收藏按钮
//    self.favorBtn = [UIButton buttonWithType:UIButtonTypeCustom];
//    self.favorBtn.frame = CGRectMake(SCREEN_WIDTH_ZH / 5 * 4, self.albumPic.frame.origin.y + self.albumPic.frame.size.height + 15, 50, 50);
//    self.favorBtn.backgroundColor = [UIColor clearColor];
//    [self.favorBtn setImage:[UIImage imageNamed:@"iconfont-shoucang-2.png"] forState:UIControlStateNormal];
//    [self.favorBtn addTarget:self action:@selector(favorBtnAction:) forControlEvents:UIControlEventTouchUpInside];
//    [self addSubview:self.favorBtn];
//    
//    
    
    
    
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
